// 封装api

const baseUrl = "https://api-hmugo-web.itheima.net/api/public/v1/"
const request = function(opations){
    opations.url = baseUrl + opations.url;
    return new Promise((resolve,reject)=>{
      wx.request({
        ...opations,
        timeout:5000,
        success:(result)=>{
          resolve(result)
        },
        fail:(err)=>{
          reject(err)
        }
      })
    })
}



export default request